<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/tabs.jsp"%>

<html>
<head>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
   var keyword = null;
	var url = null;

	//添加或编辑
	function showEditPage(isEdit){
		url = getAction('editPage');
		if(isEdit){
			if(keyword == null){
				Alert('请选择一条数据进行编辑操作！');
				return;
			}
			url = url + '&keyword=' + keyword;
			top.windowOpen(url, 'EditPage', '编辑派工', 480, 700,true,"EditPage");
		}
		top.windowOpen(url, 'EditPage', '添加派工', 480, 700,true,"EditPage");
	}

	function itemDelete(){
	 	  if(keyword == null){
	 	   	Alert('请选择数据！');
	      return false;
	 	  }
	 	  else{
	 		 url = getAction('checkDeleteDispatchIsTrue');
	 		 var param = "&keyword=" + keyword;
	 		 new Ajax.Request(url,{method: 'post',parameters:param,onSuccess : function(result){
	 			ajaxSubmitException(result.responseText);
	    		AskConfirm("${key.tipsByDeleteConfirm}","main","deletePerfectItemDispatch");
	 		}}
	 		 );
	 	  }
	}


	//删除
	function deletePerfectItemDispatch(){
	url = getAction('deletePerfectItemDispatch');
	 var param="keyword="+keyword;
	 new Ajax.Request(url,{method: 'post',parameters:param,onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		refresh();
		}}
	 );
	}


	//取得Action
	function getAction(method){
		return '${ctx }/occupation_perfectItemDispatchAction.do?method=' + method;
	}


	function setIdAndUrl(id,urltemp){
	keyword=id;
	url=urltemp;
	}

	function searchDispatch(){
		document.searchList.submit();
		keyword=null;
	    url=null;
	}

	//刷新列表
	function refresh(){

		document.getElementById('perfectItemDispatchList').src = '${ctx }/occupation_perfectItemDispatchAction.do?method=queryPerItemDispaListPage';
	}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>整改派工</title>
</head>
<body style="overflow: auto;">
<div class="pageNav_bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td id="pageNav_leftimg"><img src="${ctx}/images/ico_smm_bjlx.gif" width="46" height="47" /></td>
		<td id="navWord"><span class="page_title">整改派工</span></td>
		<td class="pageNav_right"><a href="javascript:showFull_in();"><img id="full_image" src="${ctx}/images/ico_fullscreen.gif" border="0" /></a></td>
	</tr>
</table>
</div>
<div class="container">

	<table width="100%" border="0" cellpadding="0" cellspacing="0" id="search02" class="bg_search" >

	<tr>
		<td>
		<table border="0" cellpadding="0" cellspacing="1">

		<form action="${ctx }/occupation_perfectItemDispatchAction.do?method=queryPerItemDispaListPage"
	   		 id="searchList" name="searchList" method="post" target="perfectItemDispatchList">
			<tr>

				<td class="grid align_left">承包商：</td>
				<td class="td_search align_left">

					<pms:unitedSelect
                       		name="contractorInfoId"
                       		id="contractorInfoId"
                       		optionLabel="contractorInfoName"
                       		optionValue="keyword"
                       		selectText="请选择..."
                       		dataList="${contractorInfoConfigList }">
                    	</pms:unitedSelect>
				</td>

				<td class="td_search" width="100" align="center">
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="buttonOffLeft" id="btn1_31"></td>
						<td class="buttonOffMiddle" id="btn1_32" onclick="searchDispatch();" onblur="btn_change(3)" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)">
							<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> 查 询
						</td>
						<td class="buttonOffRight" id="btn1_33"></td>
					</tr>
				</table>
				</td>
				<td>
				<table border="0" cellpadding="0" cellspacing="0">
				</table>
				</td>
			</tr>
</form>
		</table>

		</td>
            </tr>
          </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>
     <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="65%">&nbsp;</td>
          <td width="35%" align="right">
			<table border="0" cellpadding="0" cellspacing="0" id="ico2">
				<tr>
				<pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=addPerfectItemDispatch">
					<td class="toolbarico"><a href="#" onclick="javascript:showEditPage(false);return false;" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新增" />&nbsp;</a></td>
					</pms:AuthTag>
					<pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=editPerfectItemDispatch">
					<td class="toolbarico"><a href="#" onClick="javascript:showEditPage(true);return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" alt="修改" width="16" height="16" border="0" align="absbottom" /></a></td>
					</pms:AuthTag>
					<pms:AuthTag authName="occupation_perfectItemDispatchAction.do?method=deletePerfectItemDispatch">
					<td class="toolbarico"><a href="#" onClick="javascript:itemDelete();return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删除" width="16" height="16" border="0" align="absbottom" /></a></td>
				</pms:AuthTag>
				</tr>
			</table>
		</td></tr>
	</table>
	</td>
	</tr></table>
		<iframe src="${ctx }/occupation_perfectItemDispatchAction.do?method=listPage" name="perfectItemDispatchList" id="perfectItemDispatchList" width="100%" height="auto" frameborder="0" scrolling="auto"> </iframe>
</div>
</body>
</html>